/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Login.java
 *
 * Created on 05/03/2011, 10:55:35
 */

package sisgraf;

/**
 *
 * @author jordan
 */
public class Login extends javax.swing.JDialog {
    /** Creates new form Login */
    public Login(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        javax.swing.JButton botaoEsqueciSenha = new javax.swing.JButton();
        javax.swing.JLabel rotuloUsuario = new javax.swing.JLabel();
        javax.swing.JButton botaoCancelar = new javax.swing.JButton();
        javax.swing.JLabel rotuloSubTituloIdentificacao = new javax.swing.JLabel();
        javax.swing.JPanel painelInferior = new javax.swing.JPanel();
        javax.swing.JLabel jLabel5 = new javax.swing.JLabel();
        javax.swing.JLabel jLabel6 = new javax.swing.JLabel();
        javax.swing.JLabel rotuloTituloSistema = new javax.swing.JLabel();
        javax.swing.JLabel rotuloSenha = new javax.swing.JLabel();
        javax.swing.JButton botaoOk = new javax.swing.JButton();
        javax.swing.JTextField campoTextoUsuario = new javax.swing.JTextField();
        campoSenha = new javax.swing.JPasswordField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sisgraf.SisgrafApp.class).getContext().getResourceMap(Login.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N
        setResizable(false);

        botaoEsqueciSenha.setText("Esqueci Minha Senha"); // NOI18N
        botaoEsqueciSenha.setName("botaoEsqueciSenha"); // NOI18N
        botaoEsqueciSenha.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtEsqueciSenhaActionPerformed(evt);
            }
        });

        rotuloUsuario.setText("Usuário:"); // NOI18N
        rotuloUsuario.setName("rotuloUsuario"); // NOI18N

        botaoCancelar.setText("Cancelar"); // NOI18N
        botaoCancelar.setName("botaoCancelar"); // NOI18N
        botaoCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBtCancelActionPerformed(evt);
            }
        });

        rotuloSubTituloIdentificacao.setText("Identificação de Acesso"); // NOI18N
        rotuloSubTituloIdentificacao.setName("rotuloSubTituloIdentificacao"); // NOI18N

        painelInferior.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        painelInferior.setName("painelInferior"); // NOI18N

        jLabel5.setText("Gráfica Modêlo"); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jLabel6.setText("Grupo de Estudo PMA"); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        javax.swing.GroupLayout painelInferiorLayout = new javax.swing.GroupLayout(painelInferior);
        painelInferior.setLayout(painelInferiorLayout);
        painelInferiorLayout.setHorizontalGroup(
            painelInferiorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelInferiorLayout.createSequentialGroup()
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 106, Short.MAX_VALUE)
                .addComponent(jLabel6))
        );
        painelInferiorLayout.setVerticalGroup(
            painelInferiorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelInferiorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel5)
                .addComponent(jLabel6))
        );

        rotuloTituloSistema.setText("SISTEMA DE ORÇAMENTO PARA SERIÇOS GRÁFICOS"); // NOI18N
        rotuloTituloSistema.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        rotuloTituloSistema.setName("rotuloTituloSistema"); // NOI18N

        rotuloSenha.setText("Senha:"); // NOI18N
        rotuloSenha.setName("rotuloSenha"); // NOI18N

        botaoOk.setText("Ok"); // NOI18N
        botaoOk.setName("botaoOk"); // NOI18N
        botaoOk.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botaoOkActionPerformed(evt);
            }
        });

        campoTextoUsuario.setText(resourceMap.getString("campoTextoUsuario.text")); // NOI18N
        campoTextoUsuario.setName("campoTextoUsuario"); // NOI18N

        campoSenha.setText(resourceMap.getString("campoSenha.text")); // NOI18N
        campoSenha.setName("campoSenha"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(rotuloTituloSistema, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(botaoOk)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(botaoCancelar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(botaoEsqueciSenha))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(rotuloUsuario)
                            .addComponent(rotuloSenha))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(campoSenha, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE)
                            .addComponent(campoTextoUsuario, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE))))
                .addContainerGap())
            .addComponent(painelInferior, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(91, Short.MAX_VALUE)
                .addComponent(rotuloSubTituloIdentificacao)
                .addGap(80, 80, 80))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(rotuloTituloSistema)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(rotuloSubTituloIdentificacao)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rotuloUsuario)
                    .addComponent(campoTextoUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rotuloSenha)
                    .addComponent(campoSenha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botaoOk)
                    .addComponent(botaoCancelar)
                    .addComponent(botaoEsqueciSenha))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(painelInferior, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        campoTextoUsuario.getAccessibleContext().setAccessibleName("jTxFdUsuario"); // NOI18N

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void botaoOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botaoOkActionPerformed
        // TODO add your handling code here:
        if (campoSenha.getText().equals("1234"))
        {
            this.dispose();
        } else
        {
            javax.swing.JOptionPane.showMessageDialog(null, "Senha Inválida !!!", "Informação", javax.swing.JOptionPane.INFORMATION_MESSAGE);
            System.exit(0);
        }

    }//GEN-LAST:event_botaoOkActionPerformed

    private void JBtCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBtCancelActionPerformed
        // TODO add your handling code here:
        System.exit(0);
    }//GEN-LAST:event_JBtCancelActionPerformed

    private void jBtEsqueciSenhaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtEsqueciSenhaActionPerformed
        // TODO add your handling code here:
        EsqueciSenha esqueciSenha = new EsqueciSenha(new javax.swing.JFrame(), true);
        esqueciSenha.setLocationRelativeTo(null);
        esqueciSenha.setVisible(true);
    }//GEN-LAST:event_jBtEsqueciSenhaActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    javax.swing.JPasswordField campoSenha;
    // End of variables declaration//GEN-END:variables

}
